import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      '/tts/api/v1': {  // 匹配前端请求的路径
        target: 'https://openspeech.bytedance.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/tts\/api\/v1/, '/api/v1'), // 移除 /tts 前缀
      },
    },
  },
})